export default {
  namespaced: true,
  state() {
    return {
      userInfo: JSON.parse(uni.getStorageSync('user') || '{}'),
    }
  },
  actions: {

  },
  mutations: {
    saveUserInfo(state, userInfo) {
      state.userInfo = userInfo
      uni.setStorageSync('user', JSON.stringify(state.userInfo))
    },
    loginOut(state) {
      state.userInfo = {}
      uni.setStorageSync('user', JSON.stringify(state.userInfo))
    }
    
  },
  getters: {}
}
